package cloud.lysky.order.feign;

import cloud.lysky.product.domain.Product;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Slf4j
@Component
public class ProductFeignClientFallBack implements ProductFeignClient {
    @Override
    public Product getProductById(Long productId) {
        log.error("ProductService is unavailable, fallback to local default product");
        Product product = new Product();
        product.setId(productId);
        product.setName("A Big Shit");
        product.setPrice(BigDecimal.ZERO);
        product.setNum(9999);
        return product;
    }
}
